package cn.net.yugu.doraemon.datahub.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: wanghongli
 * @create: 2022-07-17 11:00:26
 */
@Data
@Component
@ConfigurationProperties(prefix = "aliyun.datahub")
public class DataHubProperties {
    /**
     * http://xxx.aliyuncs.com
     */
    private String endpoint;

    /**
     * 默认不开启.
     */
    private boolean enabled = false;

    /**
     * account
     */
    private String accessId;

    /**
     * password
     */
    private String accessKey;

    /**
     * private cloud || public cloud
     */
    private boolean isPrivate;

    /**
     * unit: ms
     */
    private Integer connTimeout = 10000;

    /**
     * 是否发消息.
     */
    private boolean produceEnabled = true;

    /**
     * 主题projectName，对应实例.
     */
    private String projectName;

    /**
     * 是否消费消息.
     */
    private boolean consumeEnabled = false;

    /**
     * 单次发送的最大数量.
     */
    private int maxSendSizePerRequest = 100;

    /**
     * 最小赞批发送大小.
     */
    private int minBatchSendSize = 2000;

    /**
     * 最大赞批发送大小，超过这个不在接受信息.
     */
    private int maxBatchSendSize = 20000;

    /**
     * 最大赞批发送的时间毫秒.
     */
    private long maxBatchSendLingerMs = 5000;
}
